<ul class="breadcrumb">
  <li><a href="/">首页</a> <span class="divider">/</span></li>
  <li><a href="/students">学生信息</a> <span class="divider">/</span></li>
  <li><%= link_to @student.name, @student %> <span class="divider">/</span></li>
  <li class="active">出勤信息</li>
</ul>
<script type="text/javascript">
    $(document).ready(function() {
        $("table").tablesorter({
            sortList: [
                [1,1]
            ]  ,
            headers: { 3: { sorter: false} }
        });
    })
</script>
<table class="zebra-striped bordered-table">
  <thead>
  <tr>
    <th>课程</th>
    <th>课程时间</th>
    <th>状态</th>
    <th>描述</th>
  </tr>
  </thead>
  <tbody>
  <% @attendances.each do |a| %>
      <tr class="<%= {0 => "n", 1=>"y"}[a.state] %>">
        <td><%= link_to truncate(a.tclass.title, :length=>20), "/attendances?cid="<<a.tclass.id.to_s %></td>
        <td><%= a.tclass.ctime.strftime("%Y-%m-%d  %H:%M") %></td>
        <td><%= raw({0=>"&oline;&oline;", 1=>"&radic;"}[a.state]) %></td>
        <td><%= truncate(a.description, :length=>35) %></td>
      </tr>
  <% end %>
  </tbody>
</table>